<template>
  <div class="page-content">
    <div class="tip">
      <i class="el-icon-success"></i>恭喜您，注册成功
    </div>
    <div>
      <el-button type="primary" style="width: 200px;" @click="onClickOpen">开通妥钱包</el-button>
    </div>

    <OpenWallet
      :visible.sync="visibleWalletOpen"
      @confirm="$router.replace('/supplier')"
    ></OpenWallet>

  </div>
</template>

<script>
import { getDomain } from '@/api/common';
import OpenWallet from '../../components/OpenWallet.vue';

export default {
  name: 'registerSuccess',

  components: { OpenWallet },

  data () {
    return {
      shopUrl: '',
      visibleWalletOpen: false,
    };
  },

  created () {
    this.getShopUrl();
  },

  methods: {
    async getShopUrl () {
      const shopDomain = await getDomain(3);
      this.shopUrl = `//${shopDomain}`;
    },

    onClickOpen () {
      this.visibleWalletOpen = true;
    },
  },
};
</script>

<style lang="scss" scoped>
.page-content {
  text-align: center;
}
.tip {
  margin-top: 100px;
  margin-bottom: 100px;
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  .el-icon-success {
    font-size: 70px;
    margin-right: 10px;
    color: #67C23A;
  }
}
</style>
